﻿// Deep Earth is a community project available under the Microsoft Public License (Ms-PL)
// Code is provided as is and with no warranty – Use at your own risk
// View the project and the latest code at http://DeepEarth.codeplex.com/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace DeepEarth.Client.MapControl
{
    public static class MultiScaleImageEx
    {
        public static IObservable<IEvent<RoutedEventArgs>> GetViewportChanged(this MultiScaleImage multiScaleImage)
        {
            return Observable.FromEvent<RoutedEventArgs>(multiScaleImage, "ViewportChanged");
        }

        public static IObservable<IEvent<RoutedEventArgs>> GetMotionFinished(this MultiScaleImage multiScaleImage)
        {
            return Observable.FromEvent<RoutedEventArgs>(multiScaleImage, "MotionFinished");
        }

        public static IObservable<IEvent<RoutedEventArgs>> GetImageOpenSucceeded(this MultiScaleImage multiScaleImage)
        {
            return Observable.FromEvent<RoutedEventArgs>(multiScaleImage, "ImageOpenSucceeded");
        }

        public static IObservable<IEvent<RoutedEventArgs>> GetImageFailed(this MultiScaleImage multiScaleImage)
        {
            return Observable.FromEvent<RoutedEventArgs>(multiScaleImage, "ImageFailed");
        }

        public static IObservable<IEvent<RoutedEventArgs>> GetImageOpenFailed(this MultiScaleImage multiScaleImage)
        {
            return Observable.FromEvent<RoutedEventArgs>(multiScaleImage, "ImageOpenFailed");
        }
    }
}